<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <h:head>
        <title>Compte Courant</title>
    </h:head>
    <h:body>

        <ui:composition template="./default.xhtml">

            <ui:define name="titrePage">
                Liste de clients 
            </ui:define>

            <ui:define name="partieGauche">
                <f:view>

                    <h:form  >


                        <p:dataTable  value="#{compteBancaireMBean.listeClientsPagines}"  widgetVar="compteTable" var="item" paginator="true" rows="5"
                                      paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                      rowsPerPageTemplate="5,10,15" 
                                      lazy="true">
                            <f:facet name="header">    
                                <p:outputPanel>
                                    <p:messages showDetail="true" id="research" globalOnly="true" autoUpdate="true"/>

                                    <h:outputLabel style="vertical-align: middle" value="Rechercher: " for="recherche"/>    

                                </p:outputPanel>
                            </f:facet> 

                            <p:column headerText="Id client"
                                      sortBy="#{item.id}"
                                      filterMatchMode="contains">
                                <f:facet name="header">
                                    <h:outputText value="Id client"/>
                                </f:facet>
                                <h:commandLink action="#{compteBancaireMBean.showDetailsClient(item)}" value="#{item.id}"/> 
                            </p:column>



                            <p:column headerText="Nom client"
                                      sortBy="#{item.id}"
                                      filterMatchMode="contains">
                                <f:facet name="header">
                                    <h:outputText value="Nom client"/>
                                </f:facet>
                                <h:outputText value="#{item.nom}"/>
                            </p:column>





                            <p:column  headerText="Prenom client"
                                       sortBy="#{item.id}"
                                       filterMatchMode="contains">
                                <f:facet name="header">
                                    <h:outputText value="Prenom client"/>
                                </f:facet>
                                <h:outputText value="#{item.prenom}"/>
                            </p:column>


                            <p:column style="text-align: center">
                                <f:facet name="header">
                                    <h:outputText value="Autre"/>
                                </f:facet>

                                <h:commandButton   action="#{compteBancaireMBean.supprimerClient(item)}" image="./images/delete.png"/>
                            </p:column>



                        </p:dataTable>


                    </h:form>

                </f:view>
            </ui:define>

        </ui:composition>

    </h:body>
</html>















